import request from '@/utils/request';

// 关联类型枚举
export const RelationTypeEnum = {
  NORMAL: 1, // 普通关联
  EXCLUSIVE: 2, // 独家代理
} as const;

// 列表查询参数接口
export interface PartnerStationParams {
  partnerId?: number;
  partnerName?: string;
  stationId?: number;
  stationName?: string;
  relationType?: number;
  pageNum?: number;
  pageSize?: number;
}

// 列表数据接口
export interface PartnerStation {
  id: number;
  partnerId: number;
  partnerName: string;
  contactName: string;
  contactPhone: string;
  partnerStatus: number;
  partnerStatusName: string;
  stationId: number;
  stationName: string;
  stationAddress: string;
  stationStatus: number;
  stationStatusName: string;
  pileCount: number;
  relationType: number;
  relationTypeName: string;
  createTime: string;
  createBy: string;
}

// 添加参数接口
export interface PartnerStationAddParams {
  partnerId: number;
  stationId: number;
  relationType: number;
}

// 获取运营商站点关联列表
export function getPartnerStationList(params: PartnerStationParams) {
  return request({
    url: '/api/partner/station/page',
    method: 'get',
    params,
  });
}

// 添加运营商站点关联
export function addPartnerStation(data: PartnerStationAddParams) {
  return request({
    url: '/api/partner/station/add',
    method: 'post',
    data,
  });
}

// 删除运营商站点关联
export function removePartnerStation(id: number) {
  return request({
    url: `/api/partner/station/remove/${id}`,
    method: 'delete',
  });
}

// 获取运营商下拉选项
export function getPartnerOptions() {
  return request({
    url: '/api/partner/list',
    method: 'get',
  });
}

// 获取充电站点下拉选项
export function getStationOptions() {
  return request({
    url: '/api/car/station/list',
    method: 'get',
  });
} 